{% load static %}
<!DOCTYPE html>
<html>
<head>
    <title>创建新文章</title>
    <link rel="stylesheet" href="{% static 'css/style.css' %}">
</head>
<body>
    <header>
        <div class="container">
            <div id="branding">
                <h1><a href="{% url 'blog:post_list' %}">我的博客</a></h1>
            </div>
            <nav>
                <ul>
                    <li><a href="{% url 'blog:post_list' %}">首页</a></li>
                    <li><a href="{% url 'blog:post_create' %}">写文章</a></li>
                </ul>
            </nav>
        </div>
    </header>

    <div class="container">
        <h1>创建新文章</h1>
        
        <form method="post">
            {% csrf_token %}
            
            <div class="form-group">
                {{ form.title.label_tag }}
                {{ form.title }}
                {% if form.title.errors %}
                    <div class="error">{{ form.title.errors }}</div>
                {% endif %}
            </div>
            
            <div class="form-group">
                {{ form.content.label_tag }}
                {{ form.content }}
                {% if form.content.errors %}
                    <div class="error">{{ form.content.errors }}</div>
                {% endif %}
            </div>
            
            <div class="form-group">
                {{ form.is_published.label_tag }}
                {{ form.is_published }}
            </div>
            
            <button type="submit" class="btn">发布文章</button>
        </form>
    </div>
</body>
</html>